package com.yanqu.road.server.cmd.building;

import com.yanqu.road.pb.building.BuildingProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.player.CollectionModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.server.command.Cmd;

@Cmd(code = Protocol.S_COLLECTION_PAVILION_UPGRADE, desc = "珍藏阁升级")
public class CollectionPavilionUpgradeCmd extends AbstractCommand {

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		ret = player.getModule(CollectionModule.class).collectionPavilionUpgrade();
	}

	@Override
	public void sendData(GamePlayer player) {
		BuildingProto.CollectionPavilionUpgradeRespMsg.Builder respMsg = BuildingProto.CollectionPavilionUpgradeRespMsg.newBuilder();
		respMsg.setRet(ret);
		player.sendPacket(Protocol.U_COLLECTION_PAVILION_UPGRADE, respMsg);
	}

}
